package  com.sieaf.exception;

import java.io.Serializable;
	/**
	 * @param args
	 */
	public class AppException extends Exception implements Serializable {

		/**��־����
		 */
		private String logType;
		/**��־��ʱ��
		 */
		private String logDateTime;
		/**��־������Ϣ
		 */
		private String logDesc;
		/**���ֵ��쳣��
		 */
		private Exception exception;
		/**���ظ�ͻ�����Ϣ
		 */
		private String clientDesc;
		/**���ظ�ͻ���Ϣ����
		 */
		private String clientType;

	    public AppException(){
			long currentTime = System.currentTimeMillis();
			java.util.Date date = new java.util.Date(currentTime);
			java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
	        this.logDateTime = formatter.format(date) ;
		}
	    public AppException(String s){
			/*long currentTime = System.currentTimeMillis();
			java.util.Date date = new java.util.Date(currentTime);
			java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat ("yyyy-MM-dd hh:mi:ss");
	        this.logDateTime = formatter.format(date) ;*/
	        clientDesc=s;
		}
		public String getLogType(){
			return logType;
		}
		public String getLogDateTime(){
			return logDateTime;
		}
		public String getLogDesc(){
			return logDesc;
		}
		public Exception getException(){
			return exception;
		}
		public String getClientDesc(){
			return clientDesc;
		}
		public String getClientType(){
		return clientType;
		}
		public void setClientDesc(String clientDesc) {
			this.clientDesc = clientDesc;
		}
		public void setException(Exception exception) {
			this.exception = exception;
		}
		public void setLogDesc(String logDesc) {
			this.logDesc = logDesc;
		}
		public void setLogType(String logType) {
			this.logType = logType;
		}
		public void setLogDateTime(String logDateTime) {
			this.logDateTime = logDateTime;
		}
		public void setClientType(String clientType) {
		this.clientType = clientType;
		}
		public String toString(){
			if(null == exception ){
				return "logType="+logType+" logDateTime="+logDateTime+" logDesc="+logDesc+" clientDest="+clientDesc+" clientType="+clientType;
			}
			else{
				return "logType="+logType+" logDateTime="+logDateTime+" logDesc="+logDesc+" Exception="+exception.getMessage()+" clientDest="+clientDesc+" clientType="+clientType;
			}
		}
		public static void main(String args[]){
			AppException ae=new AppException();
			System.out.println(ae.toString()  ) ;
		}
	}